﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:Custom="http://www.codeplex.com/prism" xmlns:Okazuki_MVVM_PrismSupport_Interactivity="clr-namespace:Okazuki.MVVM.PrismSupport.Interactivity;assembly=Okazuki.MVVM.PrismSupport"
    xmlns:l="clr-namespace:SampleApplication"
	mc:Ignorable="d"
	x:Class="SampleApplication.PersonView"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480" MinWidth="250">

	<Grid x:Name="LayoutRoot" d:DataContext="{d:DesignData /SampleData/PersonViewModelSampleData.xaml}" Background="White">
        <Grid.RowDefinitions>
        	<RowDefinition Height="Auto" />
        	<RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
		<i:Interaction.Triggers>
            <l:DebugTrigger />
			<Custom:InteractionRequestTrigger SourceObject="{Binding WindowCloseRequest}">
				<Okazuki_MVVM_PrismSupport_Interactivity:WindowCloseAction/>
			</Custom:InteractionRequestTrigger>
		</i:Interaction.Triggers>
        <StackPanel x:Name="stackPanel1" Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right">
            <Button Content="OK" Height="23" x:Name="button1" Width="75" Margin="2.5" Command="{Binding CommitCommand}" />
            <Button Content="Cancel" Height="23" x:Name="button2" Width="75" Margin="2.5" Command="{Binding CancelCommand}" />
        </StackPanel>
        <ItemsControl Grid.Row="1" Margin="5" ItemsSource="{Binding Path=ValidationErrors}" />
        <Grid Margin="5">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
        		<ColumnDefinition Width="Auto"/>
        		<ColumnDefinition/>
        	</Grid.ColumnDefinitions>
        	<TextBox x:Name="textBox1" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Grid.Column="1" Margin="2" />
        	<Label Content="名前：" Target="{Binding Mode=OneWay}" HorizontalAlignment="Right" />
            <Label Content="生年月日：" Target="{Binding Mode=OneWay}"  Grid.Row="1" HorizontalAlignment="Right" />
            <DatePicker Grid.Column="1" Grid.Row="1" Name="datePickerBirthday" Margin="2" SelectedDate="{Binding Path=Birthday}" />
        </Grid>
    </Grid>
</UserControl>